﻿
@Html.DevExpress().GridView(
settings =>
{
    settings.Name = "gridView";
    settings.InitDefaultPagerGridViewSettings();
    
    settings.EnableAlternatingRowColor();
    settings.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords;
    settings.CallbackRouteValues = new { Controller = "System", Action = "SettingsPartialView" ,id=Html.ViewContext.RouteData.Values["id"]};

    settings.KeyFieldName = "BASE_CODE";
    settings.Columns.Add("BASE_NAME", "参数名称");

    settings.Columns.Add(col =>
    {
        col.CellStyle.Paddings.Padding = 1;
        col.CellStyle.Paddings.PaddingLeft = 5;
        col.Caption = "";
        col.Width = 160;
        col.CellStyle.HorizontalAlign = HorizontalAlign.Center;

        col.SetDataItemTemplateContent(c =>
        {
            string key = DataBinder.Eval(c.DataItem, "BASE_CODE").ToString();
            ViewContext.Writer.Write(
                Html.ActionLink("[编辑]", "", null, new { href = "javascript:edit('" + key + "');" }) 
                //+"&nbsp;"+
               // Html.ActionLink("[删除]", "DeleteSettings", new { id = key }, new { onclick = "return confirm('是否要删除选定的参数?')" })
                
            );
        }
        );
    });
    
}).Bind(Model).GetHtml()
